package com.guyaogg.gulimall.product.vo;

import com.guyaogg.gulimall.product.entity.SkuImagesEntity;
import com.guyaogg.gulimall.product.entity.SkuInfoEntity;
import com.guyaogg.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;

import java.util.List;

/**
 * @author 顾遥
 */
@Data
public class SkuItemVO {
    /**
     * 1.sku 基本信息获取  pms_sku_info
     */
    private SkuInfoEntity info;

    @SuppressWarnings("AlibabaPojoNoDefaultValue")
    private Boolean hasStock = true;

    /**
     * 2.sku 的图片信息  pms_sku_images
     */
    private List<SkuImagesEntity> images;

    /**
     * 3.获取 sku 的销售属性组合
     */
    List<ItemSaleAttrsVO> saleAttrs;

    /**
     * 4.获取 spu 的介绍 pms_spu_info_desc
     */
    private SpuInfoDescEntity desc;

    /**
     * 5.获取 spu 的规格参数信息
     */
    private List<SpuItemBaseAttrVO> groupAttrs;

    /** 当前商品秒杀优惠信息*/
    private SeckillInfoVO seckillInfoVO;


    /**
     * sku 的销售属性组合
     */
    @Data
    public static class ItemSaleAttrsVO {
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVO> attrValues;

    }
    @Data
    public static class AttrValueWithSkuIdVO {
        private String attrValue;
        private String skuIds;

    }

    /**
     * spu 的规格参数信息
     */
    @Data
    public static class SpuItemBaseAttrVO {
        private String groupName;
        private List<SpuBaseAttrVO> attrs;

    }

    @Data
    public static class SpuBaseAttrVO {
        private Long attrId;
        private String attrName;
        private String attrValue;
    }

}
